package com.itheima.Demo3;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class Demo {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("D:\\\\字符流和字节流.txt"));
        char[] chars = new char[1024];
        StringBuilder stringBuilder = new StringBuilder();
        int len;
        while((len = isr.read(chars)) != -1){
            stringBuilder.append(chars,0,len);
        }
        isr.close();

        String s = stringBuilder.toString();
        System.out.println(s);
    }
}
